#include <iostream>
#include <vector>
#include <cstdio> 
#include <cstring>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int >  vec;
typedef pair < int , int > pii;

int read() {
  int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
  while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 5e5 + 10;

int f[N][22],g[N][22],n,d,cost[N];
bool vis[N];
vec G[N];

void dfs(int x,int p) {
    if(vis[x]) f[x][0] = g[x][0] = cost[x]; else f[x][0] = g[x][0] = 0;
    for(int i = 1;i <= d;i++) f[x][i] = cost[x];
    for(auto y : G[x]) if(y ^ p) dfs(y,x);
    for(auto y : G[x])
	if(y ^ p) {
	    for(int i = d;i >= 0;i--) f[x][i] = min(min(f[x][i] + g[y][i],g[x][i + 1] + f[y][i + 1]),f[x][i] + f[y][i + 1]);
	    for(int i = d;i >= 0;i--) f[x][i] = min(f[x][i],f[x][i + 1]);
	    g[x][0] = f[x][0];
	    for(int i = 1;i <= d;i++) g[x][i] += g[y][i - 1];
	    for(int i = 1;i <= d;i++) g[x][i] = min(g[x][i],g[x][i - 1]);
	}
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in,d = in; for(int i = 1;i <= n;i++) cost[i] = in;
    for(int i = 1,m = in;i <= m;i++) vis[in] = 1;
    for(int i = 1,u,v;i < n;i++) u = in,v = in,G[u].pb(v),G[v].pb(u); memset(f,0x3f,sizeof f);
    dfs(1,0); printf("%d\n",f[1][0]);
} 
